//index.js
//获取应用实例
const app = getApp()

Page({
    data: {
        winWidth: 0,
        winHeight: 0,
        currentTab: 0, 
        Active:156,
        ajaxData:{
            "datas":[
                {
                    "head":"../../images/head.png",
                    "keshi":"内分泌1",
                    "name":"张三丰1",
                    "zhicheng":"主任医师1",
                    "shanchang":"内科",
                    "tj":true

                },{
                    "head": "../../images/head.png",
                    "keshi": "内分泌11",
                    "name": "张三丰21",
                    "zhicheng": "主任医师21",
                    "shanchang": "肝病、内科疑难杂症、脾肾阳虚",
                    "tj": false
                }, {
                    "head": "../../images/head.png",
                    "keshi": "外科11",
                    "name": "陈独秀21",
                    "zhicheng": "院长21",
                    "shanchang": "肝病、内科疑难杂症、脾肾阳虚",
                    "tj": true
                }, {
                    "head": "../../images/head.png",
                    "keshi": "眼科11",
                    "name": "李大钊21",
                    "zhicheng": "主任医师21",
                    "shanchang": "肝病、内科疑难杂症、脾肾阳虚",
                    "tj": false
                }
            ],
        "datas2":[
            {
                "head": "../../images/head.png",
                "keshi": "内分泌1",
                "name": "张三丰1,陈独秀21",
                "shanchang": "内科",

            }, {
                "head": "../../images/head.png",
                "keshi": "内分泌11",
                "name": "张三丰21",
                "shanchang": "肝病、内科疑难杂症、脾肾阳虚",
            }, {
                "head": "../../images/head.png",
                "keshi": "外科11",
                "name": "陈独秀21",
                "shanchang": "肝病、内科疑难杂症、脾肾阳虚",
            }, {
                "head": "../../images/head.png",
                "keshi": "眼科11",
                "name": "李大钊21,陈独秀21",
                "shanchang": "肝病、内科疑难杂症、脾肾阳虚",
            }
        ]
        }
    },

    onLoad: function () {
            var that = this;  
            wx.getSystemInfo({
                success: function (res) {
                    that.setData({
                        winWidth: res.windowWidth,
                        winHeight: res.windowHeight
                    });
                }
            });  
    },
    bindChange: function (e) {
        var that = this;
        that.setData({ currentTab: e.detail.current });
    },  
    swichNav: function (e) {
        var that = this;
        if (this.data.currentTab === e.target.dataset.current) {
            return false;
        } else {
            that.setData({
                currentTab: e.target.dataset.current
            })
        }
    },
    changeType:function(e){
        var _this=this;
        if(this.data.Active===e.target.dataset.active){
            return false;
        }else{
            _this.setData({
                Active: e.target.dataset.active
            })
        }
      
    } 
})
